<template>
    <div class="app">
        <div v-if="group" v-wechat-title="$route.meta.title=group.name"></div>
        <div class="top"><router-link to="/" class="home"><img src="@/image/group_to_shop.jpg" alt=""></router-link><div class="tab" :class="tab==0?'activate':''" @click="settab(0)">今日团购</div><div class="tab" :class="tab==1?'activate':''" @click="settab(1)">群主推荐</div></div>
        <div class="list_box">
            <div class="go_list" v-if="tab==0">
                <div class="item" v-for="(item,index) in golist" @click="todetail(item.id)">
                    <div class="pic"><img :src="resurl+item.goods_pic+'?x-oss-process=image/resize,m_fill,w_720,h_360'"
                                          alt=""></div>

                    <div class="info">
                        <div class="name">{{item.goods_name}}</div>
                        <div class="tuan_price">团购价:<span>{{item.price}}</span></div>
                        <div class="price">零售价:<span>{{item.goods_price}}</span></div>
                        <div class="number">满团人数:{{item.current_number}}/{{item.number}}</div>
                        <div class="endtime_str endtime" v-html="item.endtime_str"></div>
                    </div>
                </div>
            </div>
            <div class="goods_list" v-if="tab==1">
                <div v-for='(item,index) in goods_list' :key='index' class="goods_item">
                    <router-link class="goods" :to="'/pages/goods/detail?id='+item.goods_id">
                        <div class="pic"><img :src="resurl+item.pic+'?x-oss-process=image/resize,m_fill,w_240,h_240'"
                                              alt=""></div>
                        <div class="info">
                            <div class="name">{{item.name}}</div>
                            <div class="sales">销量:{{item.sales}}</div>
                            <div class="price">￥{{item.price}}</div>
                        </div>
                    </router-link>
                </div>
            </div>
        </div>
    </div>
</template>
<script src="./main.js"></script>
<style lang="less" src="./main.less" scoped></style>
